package com.yuanqi.controller;

import com.yuanqi.service.FinanceDashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/finance/dashboard")
@CrossOrigin(origins = "*")
public class FinanceDashboardController {
    
    @Autowired
    private FinanceDashboardService dashboardService;
    
    @GetMapping
    public ResponseEntity<Map<String, Object>> getDashboardData() {
        Map<String, Object> dashboardData = dashboardService.getDashboardData();
        return ResponseEntity.ok(dashboardData);
    }
}


